//
//  PGBView.m
//  DongFeng_Online-Banking-APP
//
//  Created by wxt on 2021/4/23.
//

#import "PGBView.h"
@interface PGBView ()
@end
static PGBView *alertView = nil;
@implementation PGBView
+(instancetype)alterViewWithtitle:(NSString * )titleStr withFrame:(CGRect)fram{

    if (alertView == nil) {
        alertView = [[PGBView alloc]initWithFrame:CGRectMake(fram.origin.x, fram.origin.y, fram.size.width, fram.size.height+10)];
        alertView.backgroundColor = [UIColor clearColor];

    }
    UIView * linView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, fram.size.width, fram.size.height-5)];
    linView.backgroundColor = JhColor(44, 44, 44);
    linView.alpha = 0.75;
    linView.layer.masksToBounds = YES;
    linView.layer.cornerRadius = 5;
    [alertView addSubview:linView];
    TKLlable * lib = [TKLlable labelWithFrame:CGRectMake(5, 0, fram.size.width-30, fram.size.height-5) text:titleStr textColor:Wcolor font:Font_6(12) textAlignment:Textleft backgroundColor:Ccolor];
    [alertView addSubview:lib];
    tklImgView* snaImg = [tklImgView imgViewWithFrame:CGRectMake(fram.size.width/2-5, CGRectGetMaxY(linView.frame)-7, 20, 20) img:@"daosanjiao"];
    [alertView addSubview:snaImg];
    
    alertView.cancleBtn = [UIButton createBtnFrame:CGRectMake(fram.size.width-25, 7, 20, 20) title:@"" bgImageName:@"@弹框_关闭_浅色" action:^(UIButton *button) {
        if ([alertView.delegate respondsToSelector:@selector(textViewCancel)]) {
            [alertView.delegate textViewCancel];
        }
    }];

    [alertView addSubview:alertView.cancleBtn];

    return alertView;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
